<template>
  <div class="page-demo">
    <div class="page-demo-center">
      <div class="page-demo-avatar"><van-icon name="manager" /></div>
      <p>{{userTelephoneNum}}</p>
      <van-divider>中国移动认证</van-divider>
      <div style="margin: 16px">
        <van-button round block type="warning" native-type="submit" @click="onLogin">
          本机号码一键登录
        </van-button>
      </div>
      <div class="page-demo-text" @click="onLogon">其他登录方式</div>
    </div>
    <div class="page-demo-feeter">
        <van-checkbox v-model="checked" shape="square">
            我已阅读并同意
            <span class="th">中国移动认证服务条款</span>
            以及<span class="th">服务使用协议</span>和<span class="th">隐私政策</span>
        </van-checkbox>
    </div>
  </div>
</template>
<script>
export default { name: "demo" };
</script>
<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
const checked = ref(false);

const phone = '17712345678'     //后续更换接口返回的电话号码
const userTelephoneNum = phone.substr(0, 3) + '****' + phone.substr(7) 

let router=useRouter();
function onLogon(){
    router.push("/login/logon")
}
function onLogin(){
    router.push("/home/commend")
}
</script>
<style lang="scss" scoped>
.page-demo {
  height: 100%;
  width: 100%;
  position: relative;
  &-center {
    width: 90%;
    height: 400px;
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    p{
        font-size: 30px;
        font-weight: bold;
    }
    .van-divider{
        font-size: 12px;
    }
    .van-button{
        font-weight: bold;
    }
  }
  &-text{
    font-size: 14px;
    color: orange;
  }
  &-avatar{
    background-color: orange;
    width: 60px;
    height: 60px;
    margin-left: 40%;
    line-height: 80px;
    border-radius: 50%;
    text-align: center;
    .van-icon{
        font-size: 40px;
    }

  }
  &-feeter {
    position: absolute;
    height: 50px;
    bottom: 50px;
    padding: 10px;

    .van-checkbox{
        font-size: 12px;
        .th{
            color: blue;
        }
    }
  }
}
</style>
